package com.atlige.gzmall.cart.vo;

import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.List;

/**
 * 购物车中的购物项
 * @author: Jeremy lI
 * @description:
 * @date: created in 2021/6/5 23:09
 */
@Data
@Accessors(chain = true)
public class CartItem {
    private Long skuId;
    private String title;
    private Boolean check = true;
    private String image;
    private List<String> skuAttr;
    private BigDecimal price;
    private Integer count;
    private BigDecimal totalPrice;
    // 计算购物项总价
    public BigDecimal getTotalPrice() {
        return this.price.multiply(new BigDecimal("" + this.count));
    }
}
